//
//  LBNavigationController.m
//  loveBeen
//
//  Created by 杨烁 on 2016/11/19.
//  Copyright © 2016年 loveBeen. All rights reserved.
//

#import "LBNavigationController.h"
#import "UIColor+CZAddition.h"

@interface LBNavigationController ()

@end

@implementation LBNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //1.取消导航栏的分隔线
    //1.1 设置一个空的背景图片
//    [self.navigationBar setBackgroundImage:[[UIImage alloc]init] forBarMetrics:UIBarMetricsDefault];
//    //1.2 设置一个空的阴影图片
//    [self.navigationBar setShadowImage:[[UIImage alloc]init]];
    
    //2.设置导航栏的背景颜色
    //只能设置navigationBar(44高度)的背景颜色.如果不设置一张空的backgroundImage,它就会被盖住
    //    self.navigationBar.backgroundColor = [UIColor redColor];
//    self.navigationBar.barTintColor = [UIColor cz_colorWithHex:0x3a3a3a];
    //半透明效果/穿透效果
//    self.navigationBar.translucent = NO;
    
    //3.设置导航条标题的文字颜色
    self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
    [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:255/255.0 green:218/255.0 blue:0/255.0 alpha:1]];
    [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
                                                           [UIColor blackColor], NSForegroundColorAttributeName, [UIFont systemFontOfSize:15], NSFontAttributeName, nil]];
    
}
//设置导航控制器的子控制器统一的状态栏样式



- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.viewControllers.count >0) {  //如果navigationController里有子控制器的时候,再隐藏底部栏
        viewController.hidesBottomBarWhenPushed = YES;
    }
    
    [super pushViewController:viewController animated:animated];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
